package com.gqz.patrol.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gqz.common.core.domain.R;
import com.gqz.common.core.domain.RequestForm;
import com.gqz.patrol.vo.EnPatrolTaskElectricityVo;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 电量采集信息表
 */


@RequestMapping("/en-patrol-task-electricity")
public interface EnPatrolTaskElectricityApi {
    @PostMapping("/{id}")
    public R<List<EnPatrolTaskElectricityVo>> getById(
            @PathVariable("id") String id);

    @PostMapping("/page")
    public R<Page<EnPatrolTaskElectricityVo>> page(
            @RequestBody RequestForm<EnPatrolTaskElectricityVo> requestForm);

    @PostMapping("/count")
    public R<Long> count(
            @RequestBody RequestForm<EnPatrolTaskElectricityVo> requestForm);

    @PostMapping("/insert")
    public R<Integer> insert(
            @RequestBody List<EnPatrolTaskElectricityVo> forms);

    @PostMapping("/update")
    public R<Integer> update(
            @RequestBody List<EnPatrolTaskElectricityVo> forms);

    @PostMapping("/delete")
    public R<Boolean> delete(
            @RequestBody List<String> ids);

    /**
     * 根据工单id获取电量采集信息
     *
     * @param taskNo 任务编号
     * @return {@link R}<{@link List}<{@link EnPatrolTaskElectricityVo}>>
     */
    @GetMapping("getByTaskNo/{taskNo}")
    R<List<EnPatrolTaskElectricityVo>> getByTaskNo(
            @PathVariable
            String taskNo);

    @PostMapping("exportExcel")
    void exportExcel(HttpServletResponse resp,
                     @RequestBody
                     RequestForm<EnPatrolTaskElectricityVo> requestForm);
}
